﻿using Styx;
using Styx.WoWInternals;

using WuzzCollection.Helpers;

namespace WuzzCollection.Classes
{
    internal partial class Warrior : AbstractClass
    {
        public override void ApproachAndFaceTarget()
        {
            if (!Me.CurrentTarget.IsWithinMeleeRange)
            {
                Styx.Pathing.Navigator.MoveTo(Me.CurrentTarget.Location);

                if (BotSettings.BotMovement && Me.CurrentTarget.Distance > 15)
                {
                    Spell.CastSpecial("Charge");
                }
            }

            if (Me.CurrentTarget.IsWithinMeleeRange)
            {
                WoWMovement.MoveStop();
                WoWMovement.ConstantFace(Me.CurrentTarget.Guid);
            }
        }

        public override bool NeedPreCombatBuffs()
        {
            return false;
        }

        public override void PreCombatBuffs()
        {
        }

        public override bool CastHeal()
        {
            return false;
        }

        public override bool CastDefensiveSpells()
        {
            return false;
        }

        public override bool CastInterrupt()
        {
            return false;
        }

        public override void Pull()
        {
            AutoAttack();
            ApproachAndFaceTarget();
        }

        public override void AutoAttack()
        {
            if (!Me.IsAutoAttacking)
            {
                Me.ToggleAttack();
            }
        }

        public override void RunRotation()
        {
            if (Me.Level < 10)
            {
                LowbieRotation();
            }
            else
            {
                switch (Me.Specialization)
                {
                    case WoWSpec.WarriorArms:
                        ArmsRotation();
                        break;
                    default:
                        LowbieRotation();
                        break;
                }
            }
        }
    }
}